# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=perl-image-exiftool
# Bump only to versions that are marked as "production release" on
# https://exiftool.org/history.html.
pkgver=12.70
pkgrel=0
pkgdesc="Perl module for editing exif metadata in files"
url="https://exiftool.org/"
arch="noarch"
license="Artistic-1.0-Perl GPL-1.0-or-later"
depends="perl"
subpackages="$pkgname-doc exiftool"
source="https://exiftool.org/Image-ExifTool-$pkgver.tar.gz"
builddir="$srcdir/Image-ExifTool-$pkgver"

# secfixes:
#   12.40-r0:
#     - CVE-2022-23935
#   12.24-r0:
#     - CVE-2021-22204

build() {
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install

	# creates file collision among perl modules
	find "$pkgdir" -name perllocal.pod -delete
	find "$pkgdir" -name .packlist -delete
}

exiftool() {
	pkgdesc="Tool for editing exif metadata in files"
	depends="perl-image-exiftool=$pkgver-r$pkgrel"

	amove usr/bin
}

sha512sums="
9771cb20590eb80b3dbbc13789d1a2973096e8eaddd5aa400561636a5b8ce5e774cfd3edbde6d928a816b95377684d9af7e0f41c2d5e7b652f50c4390640cba1  Image-ExifTool-12.70.tar.gz
"
